<div class="row">
<div class="panel callout"><h6>Edit Lesson</h6></div>
	<?if(isset($system_message))echo $system_message;?>
	<?php echo validation_errors('<div data-alert class="alert-box">','</div>');?>
	<?require('navigation/lesson_nav.php');?>
	
	<?if(!empty($lesson)):?>
		<form action="<?=site_url(array('teacher','edit_lesson',$lesson->lesson_id));?>" method="post" class="custom submit_forms" enctype="multipart/form-data" accept-charset="utf-8">
			<div class="panel"><input type="text" name="lesson[lesson_title]" value="<?=$lesson->lesson_title?>" style="font-size:large;" placeholder="Lesson Title"></div>
						
			<div class="row">
				<div class="large-12 columns">
					<label>Grading Period</label>
					<select name="lesson[gp_id]">
						<?foreach($period AS $p => $val):?>
							<option value="<?=$val['value'];?>" <?if($lesson->gp_id == $val['value']) echo 'selected';?>><?=ucwords($val['title']);?></option>
						<?endforeach;?>
					</select>
				</div>
			</div>
			
			<div class="row">
				<div class="large-6 columns">
					<label>Grade Level</label>
					<select name="lesson[lvl_id]">
						<?foreach($level AS $l => $val):?>
							<option value="<?=$val['value'];?>" <?if($lesson->lvl_id == $val['value']) echo 'selected';?>><?=ucwords($val['title']);?></option>
						<?endforeach;?>
					</select>
				</div>
				<div class="large-6 columns">
					<label>Section</label>
					<select name="lesson[section_id]">
						<?foreach($section AS $s => $val):?>
							<option value="<?=$val['value'];?>" <?if($lesson->section_id == $val['value']) echo 'selected';?>><?=ucwords($val['title']);?></option>
						<?endforeach;?>
					</select>
				</div>
			</div>
			
			<div class="row">
				<div class="large-12 columns">
					<label>Subjects</label>
					<select name="lesson[sbj_id]">
						<?foreach($subject AS $s => $val):?>
							<option value="<?=$val['value'];?>" <?if($lesson->sbj_id == $val['value']) echo 'selected';?>><?=ucwords($val['title']);?></option>
						<?endforeach;?>
					</select>
				</div>
			</div>
			
			<div class="row">
				<div class="large-12 columns">
					<label>Lesson Description</label>
					<textarea name="lesson[lesson_desc]" style="min-height:100px;max-height:100px;"><?=$lesson->lesson_desc;?></textarea>
				</div>
			</div>
			
			<div class="row">
				<div class="large-12 columns">
					<label>File Attachment</label>
				</div>
			</div>
			<?if($lesson->lesson_file_name):?>
				<fieldset>
					<a href="#"><?=$lesson->lesson_file_name;?></a>
					<br />
					<br />
					<div class="alert-box secondary">Change File (formats: -.doc, -.docx, -.txt, -.jpg)</div>
					<input type="file" name="userfile" />
				</fieldset>
			<?else:?>
				<fieldset>
					<div class="alert-box secondary">Allowed formats: -.doc, -.docx, -.txt, -.jpg</div>
					<input type="file" name="userfile" />
				</fieldset>
			<?endif;?>
			<a href="#" class="button success small submit_btns">Update Lesson</a>
		</form>
	<?else:?>
		<div data-alert class="alert-box alert">No such lesson.</div>
	<?endif;?>
</div>

